<template>
  <Form
    name="dictForm"
    ref="formDict"
    :labelCol="labelCol"
    :wrapperCol="wrapperCol"
    @finish="onToolFinish"
    :initialValues="currentForm"
  >
     <div class="solution-css">
    <Card class="header-no-top">
      <Row class="card-row">
        <Col :span="3" :offset="1"><div>项目名称：</div></Col>
        <Col :span="20"><div>达梦数据库功能性测试</div></Col>
      </Row>
      <Row class="card-row">
        <Col :span="3" :offset="1"><div>项目编码：</div></Col>
        <Col :span="20"><div>20220412333</div></Col>
      </Row>
      <Row class="card-row">
        <Col :span="3" :offset="1"><div>项目介绍：</div></Col>
        <Col :span="20"
          ><div>
          </div></Col
        >
      </Row>
    <Row class="card-row">
        <Col :span="3" :offset="1"><div>产品名称：</div></Col>
        <Col :span="20"><div>达梦数据库V1.0安全版</div></Col>
      </Row>
       <Row class="card-row">
        <Col :span="3" :offset="1"><div>占用资源：</div></Col>
        <Col :span="20"><div>虚拟机---192.168.33.18</div></Col>
      </Row>
       <Row class="card-row">
        <Col :span="3" :offset="1"><div>项目开始时间：</div></Col>
        <Col :span="20"><div>2022年05月23日</div></Col>
      </Row>
    </Card>
    <Card title="进度填报-金仓高可用解决方案">
         <Table
         :pagination="false"
      :columns="columns3"
      :dataSource="data"
      :bordered="false"
      rowKey="id"
    >
    </Table>
    </Card>
    <Card title="项目完成">
 <Form name="user" ref="form" :labelCol="labelCol" :wrapperCol="wrapperCol">
      <Row>
        <Col :span="12" :offset="5">
          <FormItem name="resourceIpw" label="项目报告">
            <Upload></Upload>
          </FormItem>
        </Col>
      </Row>
      <Row>
        <Col :span="12" :offset="5">
          <FormItem name="resourceType" label="完成时间">
            <Input placeholder="请输入工具名称" style="width: 100%" />
          </FormItem>
        </Col>
      </Row>
      <Row>
        <Col :span="12" :offset="5">
          <FormItem name="resourceIps" label="结果描述">
               <TextArea
              placeholder="请输入"
              style="width: 100%;"
              allowClear
              @input="onInput"
            />
          </FormItem>
        </Col>
      </Row>
 
      <Row>
        <Col :span="24">
          <FormItem :wrapperCol="24" style="text-align: center">
            <Button type="primary" size="md" style="width: 100px;">提交</Button>
            <Button style="margin-left: 20px;width: 100px;" size="md">取消</Button>
          </FormItem>
        </Col>
      </Row>
    </Form>
    </Card>
  </div>
  </Form>
</template>

<script>
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
import { Message } from "@uni/vue";
export default {
  dicts: ['resource_type'],
  props: {
    id: {
      default: "",
    },
    currentRow: {
      default: () => {},
    },
  },
  data() {
    return {
      labelCol: {
        span: 6,
      },
      wrapperCol: {
        span: 18,
      },
      currentForm: {
        resourceNumber: this.currentRow.resourceNumber,
        resourceName: this.currentRow.resourceName,
        resourceType: this.currentRow.resourceType,
        status: this.currentRow.status == "0" ? "0" : "1",
        fatoryName: this.currentRow.fatoryName,
        ipAddress: this.currentRow.ipAddress,
        address:  this.currentRow.address,
        remark:  this.currentRow.remark,
      },
      dictNameRules: [{ required: true, message: "请输入字典名称" }],
      dictTypeRules: [{ required: true, message: "字典类型不能为空" }],
      roleOptions: [],
    };
  },
  methods: {
    handleCancel() {
      this.$emit("handleCancel");
    },
    sumbitForm() {
      this.$refs.formDict.submit();
    },
    onToolFinish(formData) {
      formData.status = formData.status === "0" ? "0" : "1";
      if (this.id) {
        formData.dictId = this.id;
        updateType(formData).then((response) => {
          if (response.code == 200) {
            Message.success({ text: "修改成功" });
            this.$emit("handleCancel");
          } else {
            Message.error({ text: "修改失败" });
          }
        });
      } else {
        addType(formData).then((response) => {
          if (response.code == 200) {
            Message.success({ text: "新增成功" });
            this.$emit("handleCancel");
          } else {
            Message.error({ text: "新增失败" });
          }
        });
      }
    },
  },
};
</script>
<style lang="scss" scoped>
::v-deep .uni-modal-body {
  padding: 0;
}
::v-deep .uni-modal-footer {
  display: none;
}
::v-deep .uni-card-title {
  display: none;
}
.solution-css {
  margin: 10px;
}

.uni-card {
  width: 100%;
  margin-bottom: 10px;
}
::v-deep .header-no-top {
  .uni-card-title {
    min-height: 0;
    padding: 0;
  }
  .uni-card-content {
    padding-top: 10px;
  }
  .tag-bm {
      justify-content: center;
      width: 100px;
      margin-right: 10px;
  }
}
 .card-row {
    margin-bottom: 20px !important;
}
.list-color{
    color: rgba(245, 154, 35, 0.650980392156863);
}
.list-bm {
    margin-bottom: 10px;
}
</style>